*******************************************************************************
******************************  TABLE A17  ************************************
****  Relationship Between Experimental Conditions and Speaking Turns  ********
*******************************************************************************
clear all
set more off

//cd "C:/Users/ganth/Dropbox/StrengthInNumbersReplicationPackage/replicable/table_a17"

*ssc install outreg2
*ssc install estout

********************************************************************************
use "table_a17_dataset_1.dta", clear
eststo clear

eststo: reg comm_labavg maleMajority female maleMajorityXfemale allMale grcomm_labavg $controls, cluster(group_id_fall)
	estadd ysumm

**Study 2 Analysis
use "table_a17_dataset_2.dta", clear
eststo: reg comm_labavg maleMajority female maleMajorityXfemale allFemale grcomm_lab1 $controls, cluster(group_id)  
estadd ysumm


**Combined Analysis
use "table_a17_dataset_3.dta", replace

eststo: reg comm_labavg maleMajority female maleMajorityXfemale allFemale allMale grcomm_lab1 $controls, cluster(group_id)  
	estadd ysumm

esttab _all using "table_a17.tex", style(tex) ///
 stats(N r2 ymean ysd, fmt( %9.0g %9.2f  %9.2f %9.2f) ///
labels("\$N$" "\$R^2$" "Mean of outcome" "St. dev. of outcome")) label replace ///
keep( maleMajority female maleMajorityXfemale) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Study 1" "Study 2" "Studies 1 + 2") ///
nonotes nonum addnotes("\begin{minipage}{.7\linewidth} \footnotesize \smallskip \textbf{Note:} Table presents individual-level analysis. The dependent variable is the individual's average proportion of speaking turns. Controls include the length of the group conversation and indicators for all-male and all-female conditions. The excluded category is majority women groups. Included controls are GPA, age, whether an individual is an international student, whether an individual is white, whether an individual is married, and an indicator for whether the individual's group met online. Heteroskedasticity-robust standard errors are reported in parentheses. Significance levels are indicated by $*$ $<.1$, ** $<.05$,  *** $<.01$.   \end{minipage}" )
	

clear

********************************************************************************
